/*
 *  Copright: 2008 Philipp Leitner, Distributed Systems Group,
 *            TU Wien, leitner@infosys.tuwien.ac.at
 *
 *  This file is part of DAIOS.
 *
 *  DAIOS is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as
 *  published by the Free Software Foundation.
 * 
 *  DAIOS is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with DAIOS.  If not, see
 *  <http://www.gnu.org/licenses/>.
 * 
 */

package at.ac.tuwien.infosys.dsg.daios.wsdl.impl;

import javax.xml.namespace.QName;

import org.apache.xmlbeans.SchemaType;

/**
 * This WSDL type is a special type of a complex type. It 
 * represents an array type as used by Axis RPC. It is
 * liek a standard complex type, except for that it also
 * has a special array type.
 * 
 * @author philipp
 *
 */
public class WSDLArrayType extends WSDLComplexType {
	
	private String arrayType = null;
	
	/**
	 * Construct a new array type.
	 * 
	 * @param name The name of the defining element of this type.
	 * @param type The underlying XMLBeans SchemaType.
	 */
	public WSDLArrayType(QName name, SchemaType type) {
		
		// call the complex type constructor
		super(name, type);
		
		// TODO: abusing the Axis1 convention here!!!!
		arrayType = name.getLocalPart().replaceFirst("ArrayOf_\\w*_","");
		
	}
	
	/**
	 * Get the String name of the array type. If this type represents
	 * a "String[]" type (ArrayOf_xsd_string) this method would
	 * yield "string" .
	 * 
	 * @return The name of the array type.
	 */
	public String getArrayType() {
		return arrayType;
	}
	
}
